const path = require('path')

const outputPath = path.join(__dirname, 'build')
const buildPath = outputPath

module.exports = {
    isMultiEnv: true,
    dev: {
        productName: 'D-EVue',
        appId: 'com.example.app.dev'
    },
    test: {
        productName: 'T-EVue',
        appId: 'com.example.app.test'
    },
    prod: {
        productName: 'EVue',
        appId: 'com.example.app'
    },
    config: {
        directories: {
            output: outputPath
        },
        publish: [
            {
                provider: 'generic',
                url: 'https://127.0.0.1/publish/'
            }
        ],
        files: [
            'dist/electron/**/*',
            '!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}',
            '!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}',
            '!**/node_modules/*.d.ts',
            '!**/node_modules/.bin',
            '!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}',
            '!.editorconfig',
            '!**/._*',
            '!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}',
            '!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}',
            '!**/{appveyor.yml,.travis.yml,circle.yml}',
            '!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}'
        ],
        extraResources: [],
        dmg: {
            contents: [
                {
                    x: 410,
                    y: 150,
                    type: 'link',
                    path: '/Applications'
                },
                {
                    x: 130,
                    y: 150,
                    type: 'file'
                }
            ]
        },
        mac: {
            icon: `${buildPath}/icons/icon.icns`
        },
        npmRebuild: false,
        nsis: {
            oneClick: false,
            perMachine: true,
            allowToChangeInstallationDirectory: true,
            createDesktopShortcut: true,
            createStartMenuShortcut: true,
            runAfterFinish: false
        },
        win: {
            icon: `${buildPath}/icons/icon.ico`,
            artifactName: '${productName}_Setup_${version}.${ext}',
            verifyUpdateCodeSignature: false,
            signingHashAlgorithms: [],
            signDlls: false,
            rfc3161TimeStampServer: 'http://rfc3161timestamp.globalsign.com/standard',
            certificateFile: `${buildPath}/cert/cert.pfx`,
            certificatePassword: '123456'
        },
        linux: {
            icon: `${buildPath}/icons`
        }
    }
}